/********************************** (C) COPYRIGHT  *******************************
* File Name          : rtc.h
* Author             : Neo-T
* Version            : V1.0.0
* Date               : 2023/08/13
* Description        : This file contains all the functions prototypes for all RTC
*                      operations
*********************************************************************************/
#ifndef _RTC_H
#define _RTC_H

#ifdef __cplusplus
extern "C" {
#endif

#ifdef SYMBOL_GLOBALS
   #define RTC_EXT
#else
   #define RTC_EXT extern
#endif //* SYMBOL_GLOBALS

typedef struct _ST_DATETIME_ {
    uint16_t usYear;
    uint8_t ubMonth;
    uint8_t ubDay;
    uint8_t ubHour;
    uint8_t ubMin;
    uint8_t ubSec;
    uint8_t ubWeekDay;
} ST_DATETIME, *PST_DATETIME;

RTC_EXT UINT8 RTCInit(void);
RTC_EXT void RTCSetSysTime(UINT16 usYear, UINT8 ubMonth, UINT8 ubDay, UINT8 ubHour, UINT8 ubMin, UINT8 ubSec);
RTC_EXT void RTCSetSystemUnixTimestamp(time_t tUnixTimestamp);
RTC_EXT void RTCGetSysTime(PST_DATETIME pstDateTime);
RTC_EXT time_t UnixTimestamp(PST_DATETIME pstDateTime);
RTC_EXT void UnixTimeToLocalTime(time_t tUnixTimestamp, INT8 *pszDatetime);
RTC_EXT time_t Time(void);

#ifdef __cplusplus
}
#endif //* #ifdef __cplusplus

#endif //* #ifndef _RTC_H



